package com.motlepluslong.view;

import java.io.IOException;

import javax.servlet.jsp.JspWriter;

import com.motlepluslong.model.Game;

public class GameView {

	/**
	 * Affiche les lettres
	 * @param g
	 * @param out
	 * @throws IOException
	 */
	public static void displayLetters(Game g, JspWriter out) throws IOException{
		out.println("<p>");
		for(int i=0;i<10;i++)
			out.println("<span class='letter'>"+g.getLetters()[i]+" </span");
		out.println("</p>");		
	}
	/**
	 * Affiche les mots proposées par le joueur
	 * @param g
	 * @param out
	 * @throws IOException
	 */
	public static void displayWords(Game g, JspWriter out) throws IOException{
		if(g.getWords()[0] != null){
			out.println("<ul>");
			for(int i=0;i<5;i++)
				if(g.getWords()[i] != null)
					out.println("<li>"+g.getWords()[i]+" : "+g.getScoreByWords()[i]+" point(s)</li>");
			out.println("</ul>");
		}
	}

}
